package com.example.demo.service.app.impl;

import com.example.demo.entity.app.AppUser;
import com.example.demo.mapper.app.AppUserMapper;
import com.example.demo.service.app.AppUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author xkx
 * @date 2019/1/7
 */
@Service
public class AppUserServiceImpl implements AppUserService {

  @Autowired
  private AppUserMapper appUserMapper;

  @Override
  public AppUser selectAppUserById(Long id) {
    return this.appUserMapper.selectByPrimaryKey(id);
  }

  @Override
  public AppUser selectAppUserByName(String name) {
    AppUser userCondi = AppUser.builder().name(name).build();
    return this.appUserMapper.selectOne(userCondi);
  }
}
